package com.mall.malladmin.controller;

import com.mall.malladmin.pojo.entity.User;
import com.mall.malladmin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping("/findAll")
    @ResponseBody
    public List<User> findAll(){
        List<User> users = userService.queryAll();
        return users;
    }
}
